Skip to content

Conversation

@sakthivelmanii
Copy link
Collaborator

@sakthivelmanii sakthivelmanii commented Nov 26, 2025

Description:

Currently with the multiplexed session, SpanFE doesn't honor transaction tag for blind-write cases. Ideally this needs to be fixed in SpanFE which takes a long time. As a temporary workaround suggested by SpanFE, we are passing transaction tag in begin request to unblock beam release.

More details: b/461229444

@sakthivelmanii sakthivelmanii requested review from a team as code owners November 26, 2025 16:00
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: spanner Issues related to the googleapis/java-spanner API. labels Nov 26, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @sakthivelmanii, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical issue in the Spanner client library where transaction tags were not correctly propagated during blind-write operations within multiplexed sessions. The change introduces a temporary, SpanFE-recommended workaround to ensure these tags are included in the beginTransaction request, thereby unblocking an important beam release.

Highlights

  • Transaction Tag Issue Resolution: Fixed an issue where transaction tags were not being honored for blind-write operations when using multiplexed sessions.
  • Temporary Workaround Implementation: Implemented a temporary solution by explicitly passing the transaction tag in the beginTransaction request, as suggested by the SpanFE team.
  • Unblocking Beam Release: This fix is critical for unblocking an upcoming beam release, addressing a dependency issue.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@sakthivelmanii
Copy link
Collaborator Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a workaround to include a transaction tag in the BeginTransactionRequest for blind writes on multiplexed sessions. The change in SessionImpl.java correctly implements this logic. The accompanying test in DatabaseClientImplTest.java is a good addition, but it currently fails for non-multiplexed sessions because it unconditionally expects the transaction tag to be present. I've provided a suggestion to make the test assertion conditional based on whether a multiplexed session is being used, ensuring the test passes in both scenarios.

Comment on lines 1917 to 1919
.isEqualTo(transactionTag);
List<CommitRequest> commitRequests = mockSpanner.getRequestsOfType(CommitRequest.class);
assertThat(commitRequests).hasSize(1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This test is part of a parameterized test suite that runs for both multiplexed and non-multiplexed sessions. The change in SessionImpl.java adds the transaction tag to the BeginTransactionRequest only for multiplexed sessions.

This assertion will fail when the test runs with multiplexed=false because the transaction tag will not be present in the BeginTransactionRequest. The test should conditionally check for the transaction tag based on whether the session is multiplexed.

    List<BeginTransactionRequest> beginTransactionRequests = mockSpanner.getRequestsOfType(BeginTransactionRequest.class);
    assertThat(beginTransactionRequests).hasSize(1);
    if (isMultiplexed()) {
      assertThat(beginTransactionRequests.get(0).getRequestOptions().getTransactionTag()).isEqualTo(transactionTag);
    } else {
      assertThat(beginTransactionRequests.get(0).getRequestOptions().getTransactionTag()).isEmpty();
    }

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request effectively implements the temporary workaround for the transaction tag issue with blind-writes in multiplexed sessions, as described. The changes in SessionImpl.java correctly apply the transaction tag to the BeginTransactionRequest when applicable. The new test case testBlindWriteWithTransactionTag in DatabaseClientImplTest.java provides good coverage for this specific scenario, verifying that the tag is propagated as expected. Overall, the solution addresses the immediate problem and includes appropriate testing.

@sakthivelmanii sakthivelmanii force-pushed the fix_transaction_tag_issue branch from f4aba5a to 1b79a2c Compare November 26, 2025 16:11
@olavloite olavloite changed the title fix: Fix transaction tag issue with the blind-write fix: Fix transaction tag issue with blind-write Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants